package com.wiegand.util {
	import flash.display.Sprite;
	import flash.events.ContextMenuEvent;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;
	import flash.ui.ContextMenu;
	import flash.ui.ContextMenuItem;

	/**
	 * @author kwiegand
	 */
	public class CustomizedContextMenu {
		
        private var _cm:ContextMenu;
		private var _target : Sprite;

		public function CustomizedContextMenu(target:Sprite){
        	_target=target;
        	
            _cm = new ContextMenu();
            _cm.hideBuiltInItems();
            
            var cmi1:ContextMenuItem = new ContextMenuItem("© 2010 wie? gand! interactive");
            cmi1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItem1Selected);
            _cm.customItems.push(cmi1);
            
            _target.contextMenu = _cm;
        }
       
        private function menuItem1Selected(e:ContextMenuEvent):void{
            var req:URLRequest = new URLRequest("http://www.wie-gand.de/impressum");
            navigateToURL(req, '_self');
        }			
		
	}
}
